<?php echo $this->render('/manage/header.phtml');?>
<style>
	#title, #keywords, #coverimage {
		width: 600px;
	}
</style>
</head>
<body>
	<div id="body-wrapper">
		<?php echo $this->render('/manage/sidebar.phtml');?>
		<div id="main-content">
			<h2><?php echo $this->id == 0 ? "添加模特生活" : "编辑模特生活";?></h2>
			<div class="clear"></div>
			<div class="content-box">
				<div class="content-box-header">
					<h3>Content box</h3>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<?php
					$modelTypeTable = Zend_Registry::get('database')->modeltype;
					$modelListTable = Zend_Registry::get('database')->modellist;
					$modelType = $this->modelType;
					$model = $this->model;
					?>
					<div style="color: red;">
						<?php
						$result = $this->result;
						if (!empty($result)) {
							echo $result['errormsg'];
						}
						?>
					</div>
					<form action="" method="post" enctype="multipart/form-data">
						<p>
							模特生活ID：<?php echo $model[$modelListTable->id];?><input type="hidden" name="<?php echo $modelListTable->id;?>" value="<?php echo $model[$modelListTable->id];?>">
							<br />
							模特生活描述（中文）：
							<br />
							<textarea rows="" cols="" name="<?php echo $modelListTable->description1;?>"><?php echo $model[$modelListTable->description1];?></textarea>
							<br />
							模特生活描述（英文）：
							<br />
							<textarea rows="" cols="" name="<?php echo $modelListTable->description2;?>"><?php echo $model[$modelListTable->description2];?></textarea>
							<br />
							模特生活描述（葡语）：
							<br />
							<textarea rows="" cols="" name="<?php echo $modelListTable->description3;?>"><?php echo $model[$modelListTable->description3];?></textarea>
							<br />
							模特生活照片（只有一张照片，提交了之后将会覆盖现在这张照片）：
							<br />
							<?php
							$pictures = $model[$modelListTable->pictures];
							if ($pictures == '') {
							    $pictures = array();
							} else {
    							$pictures = unserialize($pictures);
                            }
							foreach ($pictures as $picture) {
							?>
							<a href="<?php
							echo $picture;?>" target="_blank"><img src="<?php
							echo $picture;?>" width="200" /></a>
							<input type="hidden" name="existpics[]" value="<?php
							echo $picture;?>">
							<?php
							}
							?>
							<br />
							<div id="pictures">
								<input name="<?php echo $modelListTable->pictures;?>[]" type="file" />
								是否设为封面
								<input type="radio" name="<?php echo $modelListTable->coverimage;?>" value="0" checked="checked">
								<br />
							</div>
							<br />
							<input type="hidden" name="<?php echo $modelListTable->type;?>" value="3">
							<br />
							是否显示：
							<input name="<?php echo $modelListTable->display;?>" type="checkbox" <?php echo $model[$modelListTable->display] == 1 ? 'checked' : '';?>
							>
							<br />
							<input name="submit" type="submit" value="确定" />
					</form>
				</div>
			</div>
			<?php echo $this->render('/manage/footer.phtml');?>
		</div>
	</div>
</body>
</html>